package com.cheems.service.impl;

import com.cheems.dao.PicClassifyMapper;
import com.cheems.entity.DTO.pageParamsDTO;
import com.cheems.entity.Pojo.picClassify;
import com.cheems.service.PicClassifyService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PicClassifyImpl implements PicClassifyService {
    @Autowired
    private PicClassifyMapper picClassifyMapper;
    /**
     * 获取分类大图
     * @return
     */
    @Override
    public List<picClassify> PicClassify(pageParamsDTO pageParamsDTO) {
        //开始分页查询
        //select * from 表 limit 0,10
        PageHelper.startPage(pageParamsDTO.getPageNum(),pageParamsDTO.getPageSize());
        //mapper返回对象
        Page<picClassify> page = picClassifyMapper.pageQuery(pageParamsDTO);
        //封装pageResult对象
        List<picClassify> result = page.getResult();

        return result;
    }
}
